package Message;


import com.special.ResideMenuDemo.R;

/**
 * Created by sirius_swu on 2017/3/6.
 * 产品类
 */
public class Product {
    private int id;
    private String name;
    private int categoryId;
    private int photo;
    private String unitPrice;
    private String note;


    public Product(int id, String name, int categoryId, int photo, String unitPrice, String note) {
        this.categoryId = categoryId;
        this.id = id;
        this.name = name;
        this.note = note;
        this.photo = photo;
        this.unitPrice = unitPrice;
    }

    public Product() {

    }

    public int getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public int getPhoto() {
        if (this.id == 1)
            return R.drawable.plant;
        else if (this.id == 2)
            return R.drawable.plant1;
        else if (this.id == 3)
            return R.drawable.plant2;
        else if (this.id == 4)
            return R.drawable.plant3;
        else if (this.id == 5)
            return R.drawable.plant4;
        else if (this.id == 6)
            return R.drawable.plant5;
        else if (this.id == 7)
            return R.drawable.plant6;
        else if (this.id == 8)
            return R.drawable.plant7;
        else
            return R.drawable.plant;
    }

    public void setPhoto(int photo) {
        this.photo = photo;
    }

    public String getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(String unitPrice) {
        this.unitPrice = unitPrice;
    }

    @Override
    public String toString() {
        return "Product{" +
                "categoryId=" + categoryId +
                ", id=" + id +
                ", name='" + name + '\'' +
                ", photo=" + photo +
                ", unitPrice=" + unitPrice +
                ", note='" + note + '\'' +
                '}';
    }
}
